package dataDTO;

public class ProductBatchCompDTO 
{
	int pbId; 	  // produktbatchets id
	int cbId;        // i omraadet 1-99999999
	double tara;
	double netto;
	int oprId;					// operatoer-nummer

	
	public ProductBatchCompDTO(int pbId, int cbId, double tara, double netto, int oprId)
	{
		this.pbId = pbId;
		this.cbId = cbId;
		this.tara = tara;
		this.netto = netto;
		this.oprId = oprId;
	}
	
	public int getPbId() { return pbId; }
	public void setPbId(int pbId) { this.pbId = pbId; }
	public int getCbId() { return cbId; }
	public void setCbId(int cbId) { this.cbId = cbId; }
	public double getTara() { return tara; }
	public void setTara(double tara) { this.tara = tara; }
	public double getNetto() { return netto; }
	public void setNetto(double netto) { this.netto = netto; }
	public int getOprId() { return oprId; }
	public void setOprId(int oprId) { this.oprId = oprId; }
	public String toString() { 
		return pbId + "\t" + cbId +"\t" + tara +"\t" + netto + "\t" + oprId ; 
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + cbId;
		long temp;
		temp = Double.doubleToLongBits(netto);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + oprId;
		result = prime * result + pbId;
		temp = Double.doubleToLongBits(tara);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ProductBatchCompDTO other = (ProductBatchCompDTO) obj;
		if (cbId != other.cbId)
			return false;
		if (Double.doubleToLongBits(netto) != Double
				.doubleToLongBits(other.netto))
			return false;
		if (oprId != other.oprId)
			return false;
		if (pbId != other.pbId)
			return false;
		if (Double.doubleToLongBits(tara) != Double
				.doubleToLongBits(other.tara))
			return false;
		return true;
	}
	
}
